package com.zhonghan.common.bean;

/**
 * 结果封装类
 * @author zhangceven
 *
 */
public class Result {

	private String code; // 返回结果码
	
	private String msg; // 返回信息
	
	private Object data; // 返回数据
	
	public Result() {
		super();
	}
	
	public Result(String code, String msg, Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	/**
	 * 设置成功返回的数据
	 * @param code
	 * @param data
	 */
	public void setSuccess(String code,Object data,String msg){
		this.code = code;
		this.data = data;
		this.msg = msg;
	}
	
	/**
	 * 设置失败返回的数据
	 * @param code
	 * @param msg
	 */
	public void setFailure(String code,String msg){
		this.code = code;
		this.msg = msg;
	}
	
}
